<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <link href="__STATIC__/Admin/css/base.css" rel="stylesheet" type="text/css" />
    <link href="__STATIC__/Admin/css/right.css" rel="stylesheet" type="text/css">
    <link href="__STATIC__/Admin/css/select.css" rel="stylesheet"  type="text/css">
    <script language="JavaScript" src="__STATIC__/js/jquery-2.1.1.min.js"></script>
    <script language="JavaScript" src="__STATIC__/js/select-ui.min.js"></script>
    <script type=text/javascript src="__STATIC__/ueditor/ueditor.config.js"></script>
    <script type=text/javascript src="__STATIC__/ueditor/ueditor.all.js"></script>
    <link rel="stylesheet" href="__STATIC__/ueditor/themes/default/css/ueditor.css"/>
    <script>
        $(document).ready(function(){
            $(function(){
            });
            $(".select1").uedSelect({
                width : 345
            });
        });
    </script>
</head>

<body>
<div class="place"> <span>位置：</span>
    <ul class="placeul">
        <li><a href="{:url('Index/center')}">首页</a></li>
        <li>
            交易二维码
        </li>
    </ul>
</div>
<div class="formbody">
    <form name="fadd" method="post" action="{:url('Qr/addQr')}" id="add" enctype="multipart/form-data">
        <ul class="forminfo">
            <li>
                <label>二维码用户名</label>
                <input type="text" name="ncontent" id="name" class="textinput" style="width:200px;height: 10px;">
                <i id="n"></i>
            </li>
            <li style="margin-top: 40px;">
                <label>上传二维码</label>
                <input type="file" name="img" id="qr" value="">
                <i id="f"></i>
            </li>
            <li style="margin-top: 30px;">
                <label>&nbsp;</label>
                <button type="button" id="true" class="btn">保存</button>
            </li>
        </ul>
    </form>
</div>
<div class="rightinfo">
    <table class="tablelist">
        <thead>
        <tr>
            <th>所有人</th>
            <th>二维码</th>
            <th>是否置顶</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
            <tr height="45" align="center">
                <td>{$vo['name']}</td>
                <td>
                    <img src="{$vo['qr']}" alt="" style="width: 60px;height: 60px;margin-top: 9px;">
                </td>
                <td>
                    {if $vo['is_select'] == 1}
                    已置顶
                    {else}
                    <a href="{:url('Qr/setTop',['id'=>$vo['id']])}">置顶</a>
                    {/if}
                </td>
                <td><a style="color: #00a0e9;" href="{:url('Qr/delQr',['id'=>$vo['id']])}" onclick="del();">删除</a></td>
            </tr>
        {/volist}
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $(function () {
        $("#true").click(function () {
            if(checkname() && checkqr()) {
                $("#add").submit();
            }
        });
        //检查二维码图片
        function checkqr()
        {
            if(!$("#qr").val()) {
                $("#f").html('<font color="red">不能为空</font>');
                return false;
            }else{
                $("#f").html('');
                return true;
            }
        }

        //检查用户名
        $("#name").blur(function () {
            checkname();
        });
        function checkname()
        {
            if(!$("#name").val()) {
                $("#n").html('<font color="red">不能为空</font>');
                return false;
            }else{
                $("#n").html('');
                return true;
            }
        }
    });

    UE.getEditor('myEditor', {
        theme:"default", //皮肤
        lang:"zh-cn", //语言
        initialFrameWidth:700,  //初始化编辑器宽度,默认800
        initialFrameHeight:320
    });

    function del(){ if(confirm("确定要删除吗？")) {   return true;  }  else  {  return false;  } }
</script>
</body>
</html>
